package com.example.wang.ghtoonui.homepage;

import android.content.Context;
import android.net.Uri;

import com.example.wang.ghtoonui.R;
import com.example.wang.ghtoonui.homepage.vo.QuickFunction;
import com.facebook.drawee.view.SimpleDraweeView;
import com.zhy.base.adapter.ViewHolder;
import com.zhy.base.adapter.recyclerview.CommonAdapter;

import java.util.List;

/**
 * @author: voiceofnet
 * email: pengkun@jingzhengu.com
 * phone:18101032717
 * @time: 2017/3/20 18:45
 * @desc:
 */
public class FunctionAdapter extends CommonAdapter<QuickFunction> {
    public FunctionAdapter(Context context, int layoutId, List<QuickFunction> datas) {
        super(context, layoutId, datas);
    }

    @Override
    public void convert(ViewHolder holder, QuickFunction quickFunction) {
        Uri uri = Uri.parse(quickFunction.getImgPath());
        SimpleDraweeView ivIcon = holder.getView(R.id.gh_homepage_quick_function_img);
        ivIcon.setImageURI(uri);
        holder.setText(R.id.gh_homepage_quick_function_text,quickFunction.getTitle());
    }
}
